package com.team.app.controller;

import javax.servlet.http.HttpSession;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.team.app.model.Vehicle;
import com.team.app.service.VehicleService;

/**
 * Handles requests for the application home page.
 */
@Controller
public class VehicleController extends AbstractController<Vehicle> {

	private static final Logger logger = LoggerFactory.getLogger(VehicleController.class);
	private final String PATH_BASE = "/vehicle";
	@Autowired
	private VehicleService vehicleService;

	// -----------------------------------------------------------------------------------
	@Override
	@RequestMapping(value = PATH_BASE, method = { RequestMethod.GET,RequestMethod.POST })
	public String indexAction(Model model, HttpSession s,Vehicle obj) {
		
		logger.info("VehicleController");
		
		model.addAttribute("vehicleData", vehicleService.findAll());
		
		return PATH_BASE + "/index";
	}

	@Override
	public String addAction(Model model, HttpSession s) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String editAction(Model model, HttpSession s, Long id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String confirmAction(Model model, HttpSession s, Vehicle obj,
			BindingResult result) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String completeAction(Model model, HttpSession s, Vehicle obj,BindingResult result) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String deleteAction(Model model, HttpSession s, Long id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String backAction(Model model, HttpSession s, Vehicle obj) {
		// TODO Auto-generated method stub
		return null;
	}

}
